"""
vas http 测试工具
"""
import json

import requests

from data_models import http_get_data

HOST = 'http://127.0.0.1:50001'


def get(url):
    res = requests.get(url)
    assert res.status_code == 200
    data = json.loads(res.content.decode('utf8'))
    return data


def http_test(host):
    pathes = http_get_data.keys()
    for p in pathes:
        print(get(f'{host}{p}'))


if __name__ == '__main__':
    http_test(HOST)
